import request from '@/utils/request'

// 查询销售汇总列表
export function listSale(query) {
  return request({
    url: '/supermarket/sale/list',
    method: 'get',
    params: query
  })
} 
export function listSaleCs(query) {
  return request({
    url: '/supermarket/sale/cSlist',
    method: 'get',
    params: query
  })
}
export function listSaleTwo(query) {
  return request({
    url: '/supermarket/sale/listTwo',
    method: 'get',
    params: query
  })
}
export function listSaleThree(query) {
  return request({
    url: '/supermarket/sale/listThree',
    method: 'get',
    params: query
  })
}

export function listSaleZf(query) {
  return request({
    url: '/supermarket/sale/listZf',
    method: 'get',
    params: query
  })
} 
// 查询销售汇总详细
export function getSale(saleId) {
  return request({
    url: '/supermarket/sale/' + saleId,
    method: 'get'
  })
}

// 新增销售汇总
export function addSale(data) {
  return request({
    url: '/supermarket/sale',
    method: 'post',
    data: data
  })
}

// 修改销售汇总
export function updateSale(data) {
  return request({
    url: '/supermarket/sale',
    method: 'put',
    data: data
  })
}

// 删除销售汇总
export function delSale(saleId) {
  return request({
    url: '/supermarket/sale/' + saleId,
    method: 'delete'
  })
}
//审核
export function auditSale(data) {
  return request({
    url: '/supermarket/sale/audit',
    method: 'post',
    data: data
  })
}
export function saleInStore(saleId) {
  return request({
    url: '/supermarket/sale/inStore/' + saleId,
    method: 'get',
  })
}
//出库操作
export function saleOutStore(saleId) {
  return request({
    url: '/supermarket/sale/outStore/' + saleId,
    method: 'get',
  })
}

// 收款单新增
export function paySale(ids) {
  return request({
    url: '/supermarket/sale/pay/' + ids,
    method: 'get',
  })
}

//反审核
export function updFsh(data) {
  return request({
    url: '/supermarket/sale/fsh',
    method: 'put',
    data: data
  })
}
//作废
export function zfSale(saleId) {
  return request({
    url: '/supermarket/sale/zfSale/' + saleId,
    method: 'get'
  })
}



